home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1999 May: Tool Chest / Developer CD Series Tool Chest (Apple Computer)(May 1999).iso / Tool Chest / Printing / STD File Saver 2.1.1 / Source / driverTypes.h < prev    next >
Encoding:
Text File  |  1996-09-24  |  5.2 KB  |  186 lines  |  [TEXT/MPS ]

  1. /*
  2. ** Copyright 1991-1996 Apple Computer. All rights reserved.
  3. **
  4. **    You may incorporate this sample code into your applications without
  5. **    restriction, though the sample code has been provided "AS IS" and the
  6. **    responsibility for its operation is 100% yours.  However, what you are
  7. **    not permitted to do is to redistribute the source as "DSC Sample Code"
  8. **    after having made changes. If you're going to re-distribute the source,
  9. **    we require that you make it clear in the source that the code was
  10. **    descended from Apple Sample Code, but that you've made changes.
  11. */
  12.  
  13. //Description of the PrintX array:
  14. //  0        used as Enum            value 0 corresponding to A4 format                 (style Dlg)
  15. //                                   value 1 corresponding to US format                 (style Dlg)
  16. //                                   value 2 corresponding to Custom format             (style Dlg)
  17. //  1        reserved
  18. //  2        used as Integer         Horizontal value for Custom format                 (style Dlg)
  19. //  3        used as Integer         Vertical value for Custom format                   (style Dlg)
  20. //  4        used as Enum            value 0 corresponding to MilliInches unit          (style Dlg)
  21. //                                   value 1 corresponding to MilliMeters unit          (style Dlg)
  22. //                                   value 2 corresponding to Pixel unit                (style Dlg)
  23. //  5        used as Boolean         value 0 corresponding to Portrait Orientation      (style Dlg)
  24. //                                   value 1 corresponding to LandScape Orientation     (style Dlg)
  25. //  6        used as Boolean         value 0 corresponding to All pages                 (job Dlg)
  26. //                                   value 1 corresponding to pages From … To …         (job Dlg)
  27. //  7        used as Integer         signature $5346 "SF"
  28. //  8        used as Boolean         value 0 corresponding to Color                     (job Dlg)
  29. //                                   value 1 corresponding to Black & White             (job Dlg)
  30. //  9-18    reserved
  31.  
  32. #define setPrintErr(err) {*((short *)0x944) = err;}
  33.  
  34. // the following two macros tell the Icon Utilities to use CopyBits
  35. // instead of using CopyMask (which doesn't hit the bottleneck)
  36. #ifndef COMPRESSED_DATA
  37. /* If we're supporting compressed data printing, we've got our own
  38. ** StdPix function (see DraftPrPix in MyPDEF_0_DraftMode.c), and
  39. ** we don't need to do this kludge
  40. */
  41. #define setIsPrintingFlag() {*((short *)0x948) = 0;}
  42. #define clearIsPrintingFlag() {*((short *)0x948) = -1;}
  43. #else /* COMPRESSED_DATA */
  44. #define setIsPrintingFlag() {}
  45. #define clearIsPrintingFlag() {}
  46. #endif /* COMPRESSED_DATA */
  47.  
  48. #ifdef isdigit
  49. /* I REALLY want my own isdigit, which won't use any globals */
  50. #undef isdigit
  51. #endif
  52. #define isdigit(c) ((c>='0')&&(c<='9'))
  53.  
  54. #define countof(foo)    (sizeof(foo)/sizeof(foo[0]))
  55.  
  56. enum {
  57.     mySignature = 0x5346    // 'SF'
  58. };
  59.  
  60. enum {        // for TextEdit selections
  61.     startSelectAll = 0,
  62.     endSelectAll = 32767
  63. };
  64.  
  65. enum {
  66.     formFeed = 0x0c,
  67.     carriageReturn = 0x0d
  68. };
  69.  
  70. enum {        // dialog items, both dialogs
  71.     printInvalidItem = -1,
  72.     printOkButton = 1,
  73.     printCancelButton
  74. };
  75.  
  76. enum {        // dialog items, page setup 
  77.     jobTitleItemID = 3,
  78.     jobRangeTitleID,
  79.     jobAllButtonID,
  80.     jobFromButtonID,
  81.     jobFromTextID,
  82.     jobToTitleID,
  83.     jobToTextID,
  84.     jobDivider1,
  85.     jobDivider2,
  86.     jobColorButtonID,
  87.     jobBlackWhiteButtonID
  88. };
  89.  
  90. enum {        // dialog items, page setup dialog
  91.     stlWindowTitleID = 3,
  92.     stlOrientationTitleID,
  93.     stlPaperTitleID,
  94.     stlPaperA4SizeButtonID,
  95.     stlPaperLetterSizeButtonID,
  96.     stlPaperCustomSizeButtonID,
  97.     stlPortraitIconID,
  98.     stlLandscapeIconID,
  99.     stlDivider1ID,
  100.     stlDivider2ID,
  101.     stlHorizTitleID,
  102.     stlVertTitleID,
  103.     stlUnitsTitleID,
  104.     stlHorizTextID,
  105.     stlVertTextID,
  106.     stlMilliInchButtonID,
  107.     stlMilliMeterButtonID,
  108.     stlPixelsButtonID,
  109.     stlHelpButtonID
  110. };
  111.  
  112. enum {        // character constants
  113.     enterKey = 3,
  114.     backspaceKey = 8,
  115.     tabKey = 9,
  116.     returnKey = 0x0d,
  117.     escape = 0x1b,
  118.     period = '.'
  119. };
  120.  
  121. enum {        // resource IDs
  122.     pageSetupDialogID = 0xE001,    // -8191
  123.     printDialogID = 0xE000,
  124.     optionsDialogID = 0xDFFF,    // -8193
  125.     helpDialogID = 0xDFFE,
  126.     badValueAlertID = -8160
  127. };
  128.  
  129. enum {    // 'STR ' IDs
  130.     chooserStrings = -8193,
  131.     longerStrings = -8194,
  132.     countChooserStrings = 11,
  133.     baseItemInfoID = -8192,
  134.     defaultFileNameID = -8191,
  135.     defaultPromptID = -8190,
  136.     unknownStrID0 = -4090,
  137.     unknownStrID1 = -4091,
  138.     unknownStrID2 = -4092,
  139.     unknownStrID3 = -4093,
  140.     unknownStrID4 = -4096
  141. };
  142.  
  143. enum {    // paper sizes
  144.     printOnA4,
  145.     printOnLetter,
  146.     printOnLegal,
  147.     printOnCustom,
  148.     printOnUndefined
  149. };
  150.  
  151. enum {    // units to measure custom size in
  152.     unitsMilliInch,
  153.     unitsMilliMeter,
  154.     unitsPixels,
  155.     unitsUndefined
  156. };
  157.  
  158. typedef struct {
  159.     GrafPtr        OtherPort;
  160.     PicHandle    thePict;
  161.     CQDProcs    cProcs;
  162.     PrIdleUPP    idleProc;
  163.     FSSpec        fileSpec;
  164.     short        fileRef;
  165.     short        CurPage;
  166.     short        firstPage;
  167.     short        lastPage;
  168. } MyPrintRec, *MyPrintPtr;
  169.  
  170. // we use this next one all over the place. The idea is to copy the GrafPort
  171. // except for picSave, rgnSave, polySave, and grafProcs. We're going to
  172. // replace those with our own values, except for those that we Just Want To
  173. // Be Nil
  174. #define mostOfGrafPort (sizeof(GrafPort)-16)
  175.  
  176. #ifndef VER_SHORT
  177. #define VER_SHORT 0
  178. #endif
  179.  
  180. #ifndef VER_STRING
  181. #define VER_STRING "Debug"
  182. #endif
  183.  
  184. #define IDENT "PictDriver "VER_STRING", Copyright 1996, Apple Computer Inc."
  185.  
  186.